package com.glsc.ngateway.common.base.dto.opmanage.report.auth;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.List;
import java.util.StringJoiner;

/**
 * @author libj
 * @date 2020/11/04
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" })
public class UrlDto {
    private Long key;

    private String title;

    private String path;

    private String url;

    private Long parentId;

    // 表示当前的层级，用于避免嵌套循环
    private int level;

    private Long value;

    private String system;

    private List<UrlDto> children;

    public Long getKey() {
        return key;
    }

    public void setKey(Long key) {
        this.key = key;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public List<UrlDto> getChildren() {
        return children;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public void setChildren(List<UrlDto> children) {
        this.children = children;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public Long getValue() {
        return value;
    }

    public void setValue(Long value) {
        this.value = value;
    }

    public String getSystem() {
        return system;
    }

    public void setSystem(String system) {
        this.system = system;
    }

    @Override
    public String toString() {
        return new StringJoiner(", ", UrlDto.class.getSimpleName() + "[", "]")
                .add("key=" + key)
                .add("title='" + title + "'")
                .add("path='" + path + "'")
                .add("url='" + url + "'")
                .add("parentId=" + parentId)
                .add("level=" + level)
                .add("children=" + children)
                .toString();
    }
}
